3.11.51 \(\int (a+i a \tan (e+f x))^m (c-i c \tan (e+f x))^4 \, dx\) [1051]

Optimal. Leaf size=134 \[ -\frac {8 i c^4 (a+i a \tan (e+f x))^m}{f m}+\frac {12 i c^4 (a+i a \tan (e+f x))^{1+m}}{a f (1+m)}-\frac {6 i c^4 (a+i a \tan (e+f x))^{2+m}}{a^2 f (2+m)}+\frac {i c^4 (a+i a \tan (e+f x))^{3+m}}{a^3 f (3+m)} \]

[Out]

-8*I*c^4*(a+I*a*tan(f*x+e))^m/f/m+12*I*c^4*(a+I*a*tan(f*x+e))^(1+m)/a/f/(1+m)-6*I*c^4*(a+I*a*tan(f*x+e))^(2+m)
/a^2/f/(2+m)+I*c^4*(a+I*a*tan(f*x+e))^(3+m)/a^3/f/(3+m)

________________________________________________________________________________________

Rubi [A]
time = 0.12, antiderivative size = 134, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3603, 3568, 45} \begin {gather*} \frac {i c^4 (a+i a \tan (e+f x))^{m+3}}{a^3 f (m+3)}-\frac {6 i c^4 (a+i a \tan (e+f x))^{m+2}}{a^2 f (m+2)}-\frac {8 i c^4 (a+i a \tan (e+f x))^m}{f m}+\frac {12 i c^4 (a+i a \tan (e+f x))^{m+1}}{a f (m+1)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^m*(c - I*c*Tan[e + f*x])^4,x]

[Out]

((-8*I)*c^4*(a + I*a*Tan[e + f*x])^m)/(f*m) + ((12*I)*c^4*(a + I*a*Tan[e + f*x])^(1 + m))/(a*f*(1 + m)) - ((6*
I)*c^4*(a + I*a*Tan[e + f*x])^(2 + m))/(a^2*f*(2 + m)) + (I*c^4*(a + I*a*Tan[e + f*x])^(3 + m))/(a^3*f*(3 + m)
)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 3603

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Di
st[a^m*c^m, Int[Sec[e + f*x]^(2*m)*(c + d*Tan[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&
EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0] && IntegerQ[m] &&  !(IGtQ[n, 0] && (LtQ[m, 0] || GtQ[m, n]))

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x))^m (c-i c \tan (e+f x))^4 \, dx &=\left (a^4 c^4\right ) \int \sec ^8(e+f x) (a+i a \tan (e+f x))^{-4+m} \, dx\\ &=-\frac {\left (i c^4\right ) \text {Subst}\left (\int (a-x)^3 (a+x)^{-1+m} \, dx,x,i a \tan (e+f x)\right )}{a^3 f}\\ &=-\frac {\left (i c^4\right ) \text {Subst}\left (\int \left (8 a^3 (a+x)^{-1+m}-12 a^2 (a+x)^m+6 a (a+x)^{1+m}-(a+x)^{2+m}\right ) \, dx,x,i a \tan (e+f x)\right )}{a^3 f}\\ &=-\frac {8 i c^4 (a+i a \tan (e+f x))^m}{f m}+\frac {12 i c^4 (a+i a \tan (e+f x))^{1+m}}{a f (1+m)}-\frac {6 i c^4 (a+i a \tan (e+f x))^{2+m}}{a^2 f (2+m)}+\frac {i c^4 (a+i a \tan (e+f x))^{3+m}}{a^3 f (3+m)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [F]
time = 61.69, size = 0, normalized size = 0.00 \begin {gather*} \int (a+i a \tan (e+f x))^m (c-i c \tan (e+f x))^4 \, dx \end {gather*}

Verification is not applicable to the result.

[In]

Integrate[(a + I*a*Tan[e + f*x])^m*(c - I*c*Tan[e + f*x])^4,x]

[Out]

Integrate[(a + I*a*Tan[e + f*x])^m*(c - I*c*Tan[e + f*x])^4, x]

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 1.28, size = 5385, normalized size = 40.19

method result size
risch \(\text {Expression too large to display}\) \(5385\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^m*(c-I*c*tan(f*x+e))^4,x,method=_RETURNVERBOSE)

[Out]

result too large to display

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^m*(c-I*c*tan(f*x+e))^4,x, algorithm="maxima")

[Out]

integrate((-I*c*tan(f*x + e) + c)^4*(I*a*tan(f*x + e) + a)^m, x)

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 255 vs. \(2 (122) = 244\).
time = 0.94, size = 255, normalized size = 1.90 \begin {gather*} -\frac {8 \, {\left (i \, c^{4} m^{3} + 6 i \, c^{4} m^{2} + 11 i \, c^{4} m + 6 i \, c^{4} e^{\left (6 i \, f x + 6 i \, e\right )} + 6 i \, c^{4} + 6 \, {\left (i \, c^{4} m + 3 i \, c^{4}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (i \, c^{4} m^{2} + 5 i \, c^{4} m + 6 i \, c^{4}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \left (\frac {2 \, a e^{\left (2 i \, f x + 2 i \, e\right )}}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{m}}{f m^{4} + 6 \, f m^{3} + 11 \, f m^{2} + 6 \, f m + {\left (f m^{4} + 6 \, f m^{3} + 11 \, f m^{2} + 6 \, f m\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, {\left (f m^{4} + 6 \, f m^{3} + 11 \, f m^{2} + 6 \, f m\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (f m^{4} + 6 \, f m^{3} + 11 \, f m^{2} + 6 \, f m\right )} e^{\left (2 i \, f x + 2 i \, e\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^m*(c-I*c*tan(f*x+e))^4,x, algorithm="fricas")

[Out]

-8*(I*c^4*m^3 + 6*I*c^4*m^2 + 11*I*c^4*m + 6*I*c^4*e^(6*I*f*x + 6*I*e) + 6*I*c^4 + 6*(I*c^4*m + 3*I*c^4)*e^(4*
I*f*x + 4*I*e) + 3*(I*c^4*m^2 + 5*I*c^4*m + 6*I*c^4)*e^(2*I*f*x + 2*I*e))*(2*a*e^(2*I*f*x + 2*I*e)/(e^(2*I*f*x
 + 2*I*e) + 1))^m/(f*m^4 + 6*f*m^3 + 11*f*m^2 + 6*f*m + (f*m^4 + 6*f*m^3 + 11*f*m^2 + 6*f*m)*e^(6*I*f*x + 6*I*
e) + 3*(f*m^4 + 6*f*m^3 + 11*f*m^2 + 6*f*m)*e^(4*I*f*x + 4*I*e) + 3*(f*m^4 + 6*f*m^3 + 11*f*m^2 + 6*f*m)*e^(2*
I*f*x + 2*I*e))

________________________________________________________________________________________

Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 2225 vs. \(2 (110) = 220\).
time = 1.64, size = 2225, normalized size = 16.60 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**m*(c-I*c*tan(f*x+e))**4,x)

[Out]

Piecewise((x*(I*a*tan(e) + a)**m*(-I*c*tan(e) + c)**4, Eq(f, 0)), (-6*c**4*f*x*tan(e + f*x)**3/(6*a**3*f*tan(e
 + f*x)**3 - 18*I*a**3*f*tan(e + f*x)**2 - 18*a**3*f*tan(e + f*x) + 6*I*a**3*f) + 18*I*c**4*f*x*tan(e + f*x)**
2/(6*a**3*f*tan(e + f*x)**3 - 18*I*a**3*f*tan(e + f*x)**2 - 18*a**3*f*tan(e + f*x) + 6*I*a**3*f) + 18*c**4*f*x
*tan(e + f*x)/(6*a**3*f*tan(e + f*x)**3 - 18*I*a**3*f*tan(e + f*x)**2 - 18*a**3*f*tan(e + f*x) + 6*I*a**3*f) -
 6*I*c**4*f*x/(6*a**3*f*tan(e + f*x)**3 - 18*I*a**3*f*tan(e + f*x)**2 - 18*a**3*f*tan(e + f*x) + 6*I*a**3*f) +
 3*I*c**4*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**3/(6*a**3*f*tan(e + f*x)**3 - 18*I*a**3*f*tan(e + f*x)**2 - 1
8*a**3*f*tan(e + f*x) + 6*I*a**3*f) + 9*c**4*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(6*a**3*f*tan(e + f*x)**
3 - 18*I*a**3*f*tan(e + f*x)**2 - 18*a**3*f*tan(e + f*x) + 6*I*a**3*f) - 9*I*c**4*log(tan(e + f*x)**2 + 1)*tan
(e + f*x)/(6*a**3*f*tan(e + f*x)**3 - 18*I*a**3*f*tan(e + f*x)**2 - 18*a**3*f*tan(e + f*x) + 6*I*a**3*f) - 3*c
**4*log(tan(e + f*x)**2 + 1)/(6*a**3*f*tan(e + f*x)**3 - 18*I*a**3*f*tan(e + f*x)**2 - 18*a**3*f*tan(e + f*x)
+ 6*I*a**3*f) + 36*c**4*tan(e + f*x)**2/(6*a**3*f*tan(e + f*x)**3 - 18*I*a**3*f*tan(e + f*x)**2 - 18*a**3*f*ta
n(e + f*x) + 6*I*a**3*f) - 36*I*c**4*tan(e + f*x)/(6*a**3*f*tan(e + f*x)**3 - 18*I*a**3*f*tan(e + f*x)**2 - 18
*a**3*f*tan(e + f*x) + 6*I*a**3*f) - 16*c**4/(6*a**3*f*tan(e + f*x)**3 - 18*I*a**3*f*tan(e + f*x)**2 - 18*a**3
*f*tan(e + f*x) + 6*I*a**3*f), Eq(m, -3)), (6*c**4*f*x*tan(e + f*x)**2/(a**2*f*tan(e + f*x)**2 - 2*I*a**2*f*ta
n(e + f*x) - a**2*f) - 12*I*c**4*f*x*tan(e + f*x)/(a**2*f*tan(e + f*x)**2 - 2*I*a**2*f*tan(e + f*x) - a**2*f)
- 6*c**4*f*x/(a**2*f*tan(e + f*x)**2 - 2*I*a**2*f*tan(e + f*x) - a**2*f) - 3*I*c**4*log(tan(e + f*x)**2 + 1)*t
an(e + f*x)**2/(a**2*f*tan(e + f*x)**2 - 2*I*a**2*f*tan(e + f*x) - a**2*f) - 6*c**4*log(tan(e + f*x)**2 + 1)*t
an(e + f*x)/(a**2*f*tan(e + f*x)**2 - 2*I*a**2*f*tan(e + f*x) - a**2*f) + 3*I*c**4*log(tan(e + f*x)**2 + 1)/(a
**2*f*tan(e + f*x)**2 - 2*I*a**2*f*tan(e + f*x) - a**2*f) - c**4*tan(e + f*x)**3/(a**2*f*tan(e + f*x)**2 - 2*I
*a**2*f*tan(e + f*x) - a**2*f) - 15*c**4*tan(e + f*x)/(a**2*f*tan(e + f*x)**2 - 2*I*a**2*f*tan(e + f*x) - a**2
*f) + 10*I*c**4/(a**2*f*tan(e + f*x)**2 - 2*I*a**2*f*tan(e + f*x) - a**2*f), Eq(m, -2)), (-24*c**4*f*x*tan(e +
 f*x)/(2*a*f*tan(e + f*x) - 2*I*a*f) + 24*I*c**4*f*x/(2*a*f*tan(e + f*x) - 2*I*a*f) + 12*I*c**4*log(tan(e + f*
x)**2 + 1)*tan(e + f*x)/(2*a*f*tan(e + f*x) - 2*I*a*f) + 12*c**4*log(tan(e + f*x)**2 + 1)/(2*a*f*tan(e + f*x)
- 2*I*a*f) - I*c**4*tan(e + f*x)**3/(2*a*f*tan(e + f*x) - 2*I*a*f) + 9*c**4*tan(e + f*x)**2/(2*a*f*tan(e + f*x
) - 2*I*a*f) + 26*c**4/(2*a*f*tan(e + f*x) - 2*I*a*f), Eq(m, -1)), (8*c**4*x - 4*I*c**4*log(tan(e + f*x)**2 +
1)/f + c**4*tan(e + f*x)**3/(3*f) + 2*I*c**4*tan(e + f*x)**2/f - 7*c**4*tan(e + f*x)/f, Eq(m, 0)), (c**4*m**3*
(I*a*tan(e + f*x) + a)**m*tan(e + f*x)**3/(f*m**4 + 6*f*m**3 + 11*f*m**2 + 6*f*m) + 3*I*c**4*m**3*(I*a*tan(e +
 f*x) + a)**m*tan(e + f*x)**2/(f*m**4 + 6*f*m**3 + 11*f*m**2 + 6*f*m) - 3*c**4*m**3*(I*a*tan(e + f*x) + a)**m*
tan(e + f*x)/(f*m**4 + 6*f*m**3 + 11*f*m**2 + 6*f*m) - I*c**4*m**3*(I*a*tan(e + f*x) + a)**m/(f*m**4 + 6*f*m**
3 + 11*f*m**2 + 6*f*m) + 3*c**4*m**2*(I*a*tan(e + f*x) + a)**m*tan(e + f*x)**3/(f*m**4 + 6*f*m**3 + 11*f*m**2
+ 6*f*m) + 15*I*c**4*m**2*(I*a*tan(e + f*x) + a)**m*tan(e + f*x)**2/(f*m**4 + 6*f*m**3 + 11*f*m**2 + 6*f*m) -
21*c**4*m**2*(I*a*tan(e + f*x) + a)**m*tan(e + f*x)/(f*m**4 + 6*f*m**3 + 11*f*m**2 + 6*f*m) - 9*I*c**4*m**2*(I
*a*tan(e + f*x) + a)**m/(f*m**4 + 6*f*m**3 + 11*f*m**2 + 6*f*m) + 2*c**4*m*(I*a*tan(e + f*x) + a)**m*tan(e + f
*x)**3/(f*m**4 + 6*f*m**3 + 11*f*m**2 + 6*f*m) + 12*I*c**4*m*(I*a*tan(e + f*x) + a)**m*tan(e + f*x)**2/(f*m**4
 + 6*f*m**3 + 11*f*m**2 + 6*f*m) - 42*c**4*m*(I*a*tan(e + f*x) + a)**m*tan(e + f*x)/(f*m**4 + 6*f*m**3 + 11*f*
m**2 + 6*f*m) - 32*I*c**4*m*(I*a*tan(e + f*x) + a)**m/(f*m**4 + 6*f*m**3 + 11*f*m**2 + 6*f*m) - 48*I*c**4*(I*a
*tan(e + f*x) + a)**m/(f*m**4 + 6*f*m**3 + 11*f*m**2 + 6*f*m), True))

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^m*(c-I*c*tan(f*x+e))^4,x, algorithm="giac")

[Out]

integrate((-I*c*tan(f*x + e) + c)^4*(I*a*tan(f*x + e) + a)^m, x)

________________________________________________________________________________________

Mupad [B]
time = 9.87, size = 332, normalized size = 2.48 \begin {gather*} -\frac {4\,c^4\,{\left (\frac {a\,\left (\cos \left (2\,e+2\,f\,x\right )+1+\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )}{\cos \left (2\,e+2\,f\,x\right )+1}\right )}^m\,\left (\cos \left (2\,e+2\,f\,x\right )\,3{}\mathrm {i}+\cos \left (4\,e+4\,f\,x\right )\,3{}\mathrm {i}+\cos \left (6\,e+6\,f\,x\right )\,1{}\mathrm {i}+3\,\sin \left (2\,e+2\,f\,x\right )+3\,\sin \left (4\,e+4\,f\,x\right )+\sin \left (6\,e+6\,f\,x\right )+1{}\mathrm {i}\right )\,\left (11\,m+18\,\cos \left (2\,e+2\,f\,x\right )+18\,\cos \left (4\,e+4\,f\,x\right )+6\,\cos \left (6\,e+6\,f\,x\right )+15\,m\,\cos \left (2\,e+2\,f\,x\right )+6\,m\,\cos \left (4\,e+4\,f\,x\right )+6\,m^2+m^3+3\,m^2\,\cos \left (2\,e+2\,f\,x\right )+6+\sin \left (2\,e+2\,f\,x\right )\,18{}\mathrm {i}+\sin \left (4\,e+4\,f\,x\right )\,18{}\mathrm {i}+\sin \left (6\,e+6\,f\,x\right )\,6{}\mathrm {i}+m^2\,\sin \left (2\,e+2\,f\,x\right )\,3{}\mathrm {i}+m\,\sin \left (2\,e+2\,f\,x\right )\,15{}\mathrm {i}+m\,\sin \left (4\,e+4\,f\,x\right )\,6{}\mathrm {i}\right )}{f\,m\,\left (m^3+6\,m^2+11\,m+6\right )\,\left (15\,\cos \left (2\,e+2\,f\,x\right )+6\,\cos \left (4\,e+4\,f\,x\right )+\cos \left (6\,e+6\,f\,x\right )+10\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(e + f*x)*1i)^m*(c - c*tan(e + f*x)*1i)^4,x)

[Out]

-(4*c^4*((a*(cos(2*e + 2*f*x) + sin(2*e + 2*f*x)*1i + 1))/(cos(2*e + 2*f*x) + 1))^m*(cos(2*e + 2*f*x)*3i + cos
(4*e + 4*f*x)*3i + cos(6*e + 6*f*x)*1i + 3*sin(2*e + 2*f*x) + 3*sin(4*e + 4*f*x) + sin(6*e + 6*f*x) + 1i)*(11*
m + 18*cos(2*e + 2*f*x) + 18*cos(4*e + 4*f*x) + 6*cos(6*e + 6*f*x) + sin(2*e + 2*f*x)*18i + sin(4*e + 4*f*x)*1
8i + sin(6*e + 6*f*x)*6i + m^2*sin(2*e + 2*f*x)*3i + 15*m*cos(2*e + 2*f*x) + 6*m*cos(4*e + 4*f*x) + m*sin(2*e
+ 2*f*x)*15i + m*sin(4*e + 4*f*x)*6i + 6*m^2 + m^3 + 3*m^2*cos(2*e + 2*f*x) + 6))/(f*m*(11*m + 6*m^2 + m^3 + 6
)*(15*cos(2*e + 2*f*x) + 6*cos(4*e + 4*f*x) + cos(6*e + 6*f*x) + 10))

________________________________________________________________________________________